sum1 = 0
for a in range(1, 101):
    if a % 10 == 3: # !=3
        continue
    sum1 += a
print(sum1)
